import request from '@/utils/api'

export const likeNote = (userId, noteId) => {
  return request.post('/api/likes', null, { params: { userId, noteId } })
}

export const unlikeNote = (userId, noteId) => {
  return request.delete('/api/likes', { params: { userId, noteId } })
}

export const unlikeAllByNoteId = (noteId) => {
  return request.delete(`api/likes/note/${noteId}`)
}

export const isLiked = (userId, noteId) => {
  return request.get('api/likes/status', { params: { userId, noteId } })
}

export const getLikeCountByNoteId = (noteId) => {
  return request.get(`api/likes/note/${noteId}/count`)
}

export const getLikeCountByUserId = (userId) => {
  return request.get(`api/likes/user/${userId}/count`)
}

export const getLikesByNoteId = (noteId) => {
  return request.get(`api/likes/note/${noteId}`)
}

export const getLikesByUserId = (userId) => {
  return request.get(`api/likes/user/${userId}`)
}